<template>
  <!-- #ifdef H5 -->
  <el-input v-bind="$attrs" v-model="bindValue">
    <template #prepend v-if="slotConfig?.prepend">
      <gd-enhance-hack-dynmic-comp :component-file-path="slotConfig.prepend.componentFilePath"
        :root-path-type="slotConfig.prepend.rootPathType ?? 'pages'" :component-props="{ ...slotConfig.prepend.props }">
      </gd-enhance-hack-dynmic-comp>
    </template>
    <template #append v-if="slotConfig?.append">
      <gd-enhance-hack-dynmic-comp :component-file-path="slotConfig.append.componentFilePath"
        :root-path-type="slotConfig.append.rootPathType ?? 'pages'" :component-props="{ ...slotConfig.append.props }">
      </gd-enhance-hack-dynmic-comp>
    </template>
    <template v-for="(slotVal, slotName, index) in $slots" :key="slotName" #[slotName]>
      <slot :name="slotName"></slot>
    </template>
  </el-input>
  <!-- #endif -->
  <!-- #ifndef H5 -->
  <input v-bind="$attrs" />
  <!-- #endif -->
</template>
<script>
export default {
  inheritAttrs: false,
};
</script>
<script setup>
// #ifdef H5
import { ElInput } from "element-plus";
import "element-plus/theme-chalk/el-input.css";
// #endif
import {
  getCurrentInstance,
  computed,
  toRefs,
  reactive,
  ref,
  watch,
  onMounted,
  markRaw,
  useSlots
} from "vue";

const props = defineProps({
  modelValue: {
    type: [String, Number],
  },
});

const emits = defineEmits(["update:modelValue"]);

const bindValue = computed({
  get() {
    return props.modelValue;
  },
  set(value) {
    emits("update:modelValue", value);
  },
});

const { proxy: vm } = getCurrentInstance();

const {
  ["slot-config"]: slotConfig,//插槽的配置---废弃不需要
  ["biz-ui-config"]: bizUiConfig,//业务特有UI的配置;通常是插槽的定制等
  ...rest
} = toRefs(vm.$attrs);

const _slots = useSlots()
</script>
<style lang="scss" scoped>

</style>
